package edu.ubbcs.rs.backend.service.basic;

import edu.ubbcs.rs.backend.model.User;
import edu.ubbcs.rs.backend.repository.UserRepository;
import edu.ubbcs.rs.backend.service.ServiceException;
import edu.ubbcs.rs.backend.service.UserService;
import java.util.List;
import javax.ejb.Stateless;
import javax.inject.Inject;

/**
 * @author Merli Andras-Bertalan
 * @version 1.0
 * @created 09-jan.-2015 15:37:43
 */
@Stateless(name = "UserService")
public class BasicUserService implements UserService {

    @Inject
    private UserRepository userRepository;

    @Override
    public User authenticate(String username, String password) throws ServiceException {
        return userRepository.getUserByUsernameAndPassword(username, password);
    }

    @Override
    public User getUserByUsername(String username) throws ServiceException {
        return userRepository.getUserByUsername(username);
    }

    @Override
    public List<User> getAll() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public User getById(Long id) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void insert(User item) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void update(User item) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void delete(User item) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void deleteAll() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Long getCount() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}
